package BasicDataType.Character

import java.lang.IllegalArgumentException

fun check(c:Char) :Int{
    if(c !in '0'..'9'){
        throw IllegalArgumentException("Out of range")
    }
    // char显示转化为数字
    return c.toInt() - '0'.toInt()
}
fun main(){
    val a =check('1')
    println(a)
}